package utils

import (
	"wit-admin-go/system/app/model"
	log "wit-admin-go/system/zaplogger"
)

// InitDB 初始化数据库
func InitDB(dst ...interface{}) {
	log.Log.Info("初始化数据库......")
	err := GetDB().AutoMigrate(&model.User{}, &model.Role{}, &model.Log{}, &model.Apis{}, &model.Menu{})
	bErr := GetDB().AutoMigrate(dst...)
	if err != nil || bErr != nil {
		log.Log.Error("数据库初始化失败")
	}
}
